import { Component, OnDestroy, OnInit } from '@angular/core';
import { ExcelService } from '@app/shared/service/utils/excel.service';
import { ShareMsgService } from '@app/shared/service/utils/share-msg.service';

import { Subscription } from 'rxjs';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.less']
})
export class HomeComponent implements OnInit,OnDestroy {
  // 整页loading
  public isLoading = false;
  subscription: Subscription;
  constructor(
    private sms: ShareMsgService,
    private excelService: ExcelService
  ) {
    this.subscription = this.sms.getMessage().subscribe(data => {
      switch (data.type) {
        case 'home_isloading_switch':
          // 用于控制整页loading
          this.isLoading=data.value;
          break;
      }
    });
  }
  ngOnDestroy(): void {
    this.subscription.unsubscribe();
  }

  ngOnInit() {
  }
  excelDownTest() {
    this.excelService.exportExcelHisSolderTest(null);
  }


}
